//
//  HomeModel.swift
//  shop
//
//  Created by chen on 2025/5/13.
//

import SwiftUI

struct MakeupItemsResp: Codable {
    var itemid: String
    var itemprice: String
    var itemtitle: String
    var itemshorttitle: String
    var itemsale: String
    var itemendprice: String
    var itempic: String
    @SafeArray var taobao_image: [String]
    
    init(itemid: String = "",
         itemprice: String = "",
         itemtitle: String = "",
         itemshorttitle: String = "",
         itemsale: String = "",
         itemendprice: String = "",
         itempic: String = "",
         taobao_image: [String] = []) {
        
        self.itemid = itemid
        self.itemprice = itemprice
        self.itemtitle = itemtitle
        self.itemshorttitle = itemshorttitle
        self.itemsale = itemsale
        self.itemendprice = itemendprice
        self.itempic = itempic
        self.taobao_image = taobao_image
    }
}

struct GoodsItemResp: Codable {
    var totalNum: Int64
    var pageId: String
    @SafeArray var list: [GoodsItem]
    
    init(totalNum: Int64 = 0, pageId: String = "1", list: [GoodsItem] = []) {
        self.totalNum = totalNum
        self.pageId = pageId
        self.list = list
    }
}

struct GoodsItem: Codable {
    var id: Int64
    var goodsId: String
    var itemLink: String
    var title: String
    var dtitle: String
    var originalPrice: Double
    var actualPrice: Double
    var shopType: Int
    var shopName: String
    var monthSales: Int64
    var desc: String
    var mainPic: String
    
    init(id: Int64 = 0,
         goodsId: String = "",
         itemLink: String = "",
         title: String = "",
         dtitle: String = "",
         originalPrice: Double = 0,
         actualPrice: Double = 0,
         shopType: Int = 0,
         shopName: String = "",
         monthSales: Int64 = 0,
         desc: String = "",
         mainPic: String = "") {
        
        self.id = id
        self.goodsId = goodsId
        self.itemLink = itemLink
        self.title = title
        self.dtitle = dtitle
        self.originalPrice = originalPrice
        self.actualPrice = actualPrice
        self.shopType = shopType
        self.shopName = shopName
        self.monthSales = monthSales
        self.desc = desc
        self.mainPic = mainPic
    }
}
